package com.iot.core.annotation;

import com.iot.core.utils.MobileValidator;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@Target({ElementType.METHOD, ElementType.FIELD})  //注解的目标范围  方法，字段上
@Retention(RetentionPolicy.RUNTIME) //运行时
@Constraint(validatedBy = MobileValidator.class)  //校验时执行的自定义类
public @interface Mobile {
    String message();
    Class<?>[] groups() default { };      //必须实现这三个方法
    Class<? extends Payload>[] payload() default { };

}
